package com.frcdi.qms.equipment.service.impl;

import com.frcdi.qms.equipment.domain.EquipmentCycle;
import com.frcdi.qms.equipment.mapper.EquipmentCycleMapper;
import com.frcdi.qms.equipment.service.IEquipmentCycleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备生命周期Service业务层处理
 *
 * @author cell
 * @date 2023-12-12
 */
@Service
public class EquipmentCycleServiceImpl implements IEquipmentCycleService
{
    @Autowired
    private EquipmentCycleMapper equipmentCycleMapper;

    /**
     * 查询设备生命周期
     *
     * @param cycleStatus 设备生命周期主键
     * @return 设备生命周期
     */
    @Override
    public EquipmentCycle selectEquipmentCycleByCycleStatus(String cycleStatus)
    {
        return equipmentCycleMapper.selectEquipmentCycleByCycleStatus(cycleStatus);
    }

    /**
     * 查询设备生命周期列表
     *
     * @param equipmentCycle 设备生命周期
     * @return 设备生命周期
     */
    @Override
    public List<EquipmentCycle> selectEquipmentCycleList(EquipmentCycle equipmentCycle)
    {
        return equipmentCycleMapper.selectEquipmentCycleList(equipmentCycle);
    }

    /**
     * 新增设备生命周期
     *
     * @param equipmentCycle 设备生命周期
     * @return 结果
     */
    @Override
    public int insertEquipmentCycle(EquipmentCycle equipmentCycle)
    {
        return equipmentCycleMapper.insertEquipmentCycle(equipmentCycle);
    }

    @Override
    public int countCycleById(Long equipmentId,String cycleStatus) {
        return equipmentCycleMapper.countCycleById(equipmentId,cycleStatus);
    }
}
